package Main;

import java.awt.BorderLayout;
import java.awt.Image;
import java.awt.Menu;
import java.awt.MenuBar;
import java.awt.MenuItem;
import java.awt.Toolkit;
import javax.swing.JFrame;
import javax.swing.JPanel;

/**
 *
 * @author VZB Casino
 */
public class Frame extends JFrame {

    //
    public MenuBar mnuBar;
    public Menu mnuFichier;
    public Menu mnuInterrogation;
    public MenuItem mnuPropos;
    public MenuItem mnuQuitter;
    public MenuItem mnuPrincipal;
    //
    public JPanel mainPanel = new JPanel(new BorderLayout());
    //
    public Bienvenue bienvenue = new Bienvenue(this);
    public int argent = 5000;
    public double miseTotal =0;
    public Image BOARD = Toolkit.getDefaultToolkit().createImage("Board.JPG");
    public Image ROULETTE = Toolkit.getDefaultToolkit().createImage("Roulette.JPG");
    Evenements evenement;

    public Frame(String title) {
        super(title);
        this.setMenuBar(mnuBar);
        this.setSize(615, 400);
        this.add(mainPanel);
        mainPanel.setLayout(new BorderLayout());
        mainPanel.add(bienvenue);
        evenement = new Evenements(this, bienvenue);
        init();
        this.setMenuBar(mnuBar);
        mnuBar.add(mnuFichier);
        mnuBar.add(mnuInterrogation);
        mnuInterrogation.add(mnuPropos);
        mnuFichier.add(mnuPrincipal);
        mnuFichier.add(mnuQuitter);
        this.setVisible(true);
        this.setResizable(false);
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    }

    public void init() {

        mnuBar = new MenuBar();
        mnuFichier = new Menu("Ficher");
        mnuInterrogation = new Menu("?");
        mnuPropos = new MenuItem("À Propos");
        mnuQuitter = new MenuItem("Quitter");
        mnuPrincipal= new MenuItem("Principal");
        mnuPropos.addActionListener(evenement);
        mnuQuitter.addActionListener(evenement);
        mnuPrincipal.addActionListener(evenement);
    }
}
